package com.dream.keigezhushou.Activity.acty.listen;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.dream.keigezhushou.Activity.acty.listen.myadapter.PinglunAdapter;
import com.dream.keigezhushou.R;

import java.util.ArrayList;

import butterknife.BindView;
import butterknife.ButterKnife;

public class PingLunActivity extends AppCompatActivity implements View.OnClickListener{


    @BindView(R.id.ib_return)
    ImageView ibReturn;
    @BindView(R.id.localmusic)
    TextView localmusic;
    @BindView(R.id.rl_ltitle)
    RelativeLayout rlLtitle;
    @BindView(R.id.pinglun_listview)
    ListView pinglunListview;
    @BindView(R.id.tv_xiepinglun)
    TextView tvXiepinglun;
    @BindView(R.id.rl_xiepinglun)
    RelativeLayout rlXiepinglun;
    @BindView(R.id.activity_ping_lun)
    RelativeLayout activityPingLun;
    private ArrayList<String> pinglunlist;
    private PinglunAdapter pinglunadapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ping_lun);
        ButterKnife.bind(this);
        initPingLun();
        setListeners();
        pinglunadapter=new PinglunAdapter(PingLunActivity.this,pinglunlist);
        pinglunListview.setAdapter( pinglunadapter);
    }

    private void setListeners() {
        ibReturn.setOnClickListener(this);
        rlXiepinglun.setOnClickListener(this);

    }

    private void initPingLun() {

        pinglunlist = new ArrayList<String>();
        for (int i = 0; i < 10; i++) {
            pinglunlist.add("" + (char) i);

        }
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case  R.id.ib_return:
                finish();
                break;
            case R.id.rl_xiepinglun:
                Toast.makeText(this,"跳转开始写评论",Toast.LENGTH_SHORT).show();
                Intent intent=new Intent(this,FaPingLunActivity.class);
                startActivity(intent);

                break;

        }

    }
}
